跳到主要内容
:root {
--primary-color: #ff4757;
--bg-color: #f7f9fc;
--card-bg: #ffffff;
}

body {
font-family:
system-ui,
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
Roboto,
Oxygen,
Ubuntu,
Cantarell,
'Open Sans',
'Helvetica Neue',
sans-serif;
background-color: var(--bg-color);
margin: 0;
color: #333333;
}

.app-container {
max-width: 1000px;
margin: 0 auto;
padding: 20px;
}

head {
text-align: center;
margin-bottom: 40px;
color: #2f3542;
}

main {
display: grid;
grid-template-columns: 2fr 1fr;
gap: 30px;
}

.grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 20px;
}

.card {
background: var(--card-bg);
border-radius: 12px;
padding: 20px;
text-align: center;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
transition: transform 0.2s;
}

.image {
font-size: 3rem;
margin-bottom: 10px;
}

.price {
color: var(--primary-color);
font-weight: bold;
font-size: 1.2rem;
margin: 10px 0;
}

button {
background-color: var(--primary-color);
color: white;
border: none;
padding: 10px 20px;
border-radius: 6px;
cursor: pointer;
font-weight: 600;
transition: opacity 0.2s;
}

/** 购物车 */
.cart {
background: var(--card-bg);
padding: 25px;
border-radius: 12px;
height: fit-content;

ul {
list-style: none;
padding: 0;
}

li {
display: flex;
align-items: center;
justify-content: space-between;
padding: 15px 0;
border-bottom: 1px solid #eeeeee;
}
}

.item-info {
display: flex;
align-items: center;
gap: 10px;
}

.icon {
font-size: 1.5rem;
}

.controls {
display: flex;
align-items: center;
gap: 10px;
button {
padding: 5px 10px;
background: #eeeeee;
color: #333333;
}
}

.total {
display: flex;
justify-content: space-between;
font-size: 1.2rem;
margin-top: 20px;
padding-top: 20px;
border-top: 2px solid #eeeeee;
}

.checkout {
width: 100%;
margin-top: 20px;
padding: 15px;
font-size: 1rem;
}

@media screen and (max-width: 768px) {
main {
grid-template-columns: 1fr;
}
}

@media (any-hover: hover) and (pointer: fine) {
.card:hover {
transform: translateY(-5px);
}

button:hover {
opacity: 0.9;
}

.remove:hover {
background: transparent;
color: red;
}
}